<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>药库到期药品管理</title>
</head>
<body>
	<div class="easyui-tabs" style="width:100%;height:100%">
		<div id="SSExpiryToolbar" style="padd-left:5px">
			<input id="SSExpiryDrugName" class="easyui-searchbox" data-options="width:150,prompt:'药品名称'">
			<span style="padding-left:10px">
				药品类<select id="SSExpiryDrugType" class="easyui-combobox" data-options="textField:'medcineTypeName',valueField:'medcinetypeId',panelHeight:'auto',width:150,url:'getAllMedcineType',method:'get'"></select>
			</span>
			<span style="padding-left:10px">
				药品到期低于<select id="SSExpiryDrugDate" class="easyui-combobox" data-options="panelHeight:'auto',width:50">
							<option value="" ></option>
							<option value="20" >20</option>
							<option value="30">30</option>
							<option value="50">50</option>
						</select>天
			</span>
			<span style="padding-left:10px">
				<a id="SSExpirySearch" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>
			</span>
		</div>
		 <div title="提醒使用药品" style="height:100%;width:100%" data-options="iconCls:'icon-add'">   
          	<table id="SSExpiryDrug" class="easyui-datagrid" style="width:100%;height:100%" 
          			data-options="toolbar:'#SSExpiryToolbar',title:'到期药品',rownumbers:true,fitColumns:true,url:'getAllSSRemindDrugs',method:'get',pagination:true">
          		<thead>
	          		<tr>
	          			<th data-options="field:'drugstorageRemindId',width:50,align:'center'">编号</th>
	          			<th data-options="field:'medcineName',width:150,align:'center'">药品</th>
	          			<th data-options="field:'medcineNumber',width:100,align:'center'">数量</th>
	          			<th data-options="field:'medcinePrice',width:50,align:'center'">单价/元</th>
	          			<th data-options="field:'medcineCost',width:100,align:'center'">总花费</th>
	          			<th data-options="field:'remindNote',width:150">备注</th>
	          			<th data-options="field:'staffname',width:100,align:'center'">登记人</th>
	          			<th data-options="field:'remaindate',width:100,align:'center'">到期时间</th>
	          		</tr>
	          	</thead>
          	</table>
	     </div>   
	     <div title="盘点到期" data-options="closable:true,iconCls:'icon-add'" style="height:100%;width:100%;overflow:auto;display:none;">   
	           <div id="SSExpiryDrug_hasDrugToolbar" style="padding-left:5px">
	           		<input class="easyui-searchbox" data-options="width:150,prompt:'药品名称'">
	           		<span style="padding-left:10px">
	           			药品类<select id="" class="easyui-combobox" data-options="textField:'medcineTypeName',valueField:'medcinetypeId',panelHeight:'auto',width:150,url:'getAllMedcineType',method:'get'">
	           			</select>
	           		</span>
	           		<span style="padding-left:10px">
	           			到期时间<input class="easyui-datebox" data-options="required:true,width:100">
	           		</span>
	           		<span style="padding-left:10px">
	           			<a class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>
	           		</span>
	           </div>
	            <table style="height:100%;width:100%" class="easyui-datagrid" 
	            		data-options="toolbar:'#SSExpiryDrug_hasDrugToolbar',title:'药库药品',rownumbers:true,fitColumns:true,url:'',method:'get',pagination:true">
	            	<thead>
	            		<tr>
	            			<th data-options="field:'',width:50,align:'center'">编号</th>
	            			<th data-options="field:'',width:50,align:'center'">编号</th>
	            			<th data-options="field:'',width:50,align:'center'">编号</th>
	            			<th data-options="field:'',width:50,align:'center'">编号</th>
	            			<th data-options="field:'',width:50,align:'center'">编号</th>
	            		</tr>
	            	</thead>
	            </table>
	     </div>   
	    
	</div>
	<script>
		$(function(){
			//按条件查询药库药品到期
			$("#SSExpirySearch").linkbutton({
				onClick : function(){
					var medcineType = $("#SSExpiryDrugType").combobox('getValue');
					var date = $("#SSExpiryDrugDate").combobox('getValue');
					$("#SSExpiryDrug").datagrid('load','getSSRmindDrugBySome?medcineType='+medcineType+"&date="+date);
					$("#SSExpiryDrugType").combobox('setValue','');
					$("#SSExpiryDrugDate").combobox('setValue','');
					
				}
			});
			$("#SSExpiryDrugName").searchbox({
				searcher : function(value,name){
					if(!value.equals('')){
						$("#SSExpiryDrug").datagrid('load','getSSRemindDrugByName?medcineName='+value);
						$("#SSExpiryDrugName").searchbox('setValue','');
					}else{
						$.messager.alert('提示','药品名不能为空');
					}
				}
			});
		});
	</script>
</body>
</html>